class Palace < ActiveRecord::Base
  validates_presence_of :name
  validates_presence_of :position1
  validates_presence_of :position2
  validates_presence_of :position3

  belongs_to :player

  def to_s
    name
  end

  def berechne_zeit(amount)
    # ROUNDUP($B2/($C2+$B2/288); 0)
    (amount / ((baum_des_lebens**1.1).round + amount/288)).round
  end

  def berechne_mana(amount)
    (amount * (baum_des_lebens**1.1).round).round
  end
end
